package org.jeecg.attachment.constant;

import org.jeecg.common.constant.enums.BaseEnum;
import org.springframework.util.unit.DataSize;

/**
 *
 * @author: qiang.zhou
 * @date: 2024/9/6 14:34
 **/
public interface AttachmentConstant {

    /** zip文件格式扩展类型 */
    String ZIP = ".zip";

    /** 未知附件类型存储位置 */
    String DEFAULT_FILE_TYPE = "other";

    /** 解析任务最大重试次数 */
    int MAX_RETRY_PARSE_TASK = 2;
    /** 未知工具分类类型 */
    String OTHER_TYPE_NAME = "其他";
    /** 解析任务处理redis锁 */
    String PARSE_TASK_REDIS_LOCK = "PARSE_TASK_REDIS_LOCK_";

    /** 超管最大上传 */
    DataSize SUPER_MAX_UPLOAD_SIZE = DataSize.parse("500MB");
    /** 习惯最大长度文件大小 */
    DataSize SYS_MAX_UPLOAD_SIZE = DataSize.parse("2GB");
    /** 图片类型字典 */
    String DICT_IMAGE_TYPE = "imageType";
    /** 上传附件类型 */
    String DICT_UPLOAD_TYPE = "uploadType";

    /**
     * 附件解析状态
     * @author: qiang.zhou
     * @date: 2024/9/9 14:41
     **/
    enum ParseStatus implements BaseEnum<Integer, String> {
        WAIT(1, "待处理"),
        SUC(2, "处理成功"),
        FAIL(3, "处理失败");

        ParseStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        private Integer code;
        private String name;
        @Override
        public Integer getCode() {
            return this.code;
        }

        @Override
        public String getName() {
            return this.name;
        }
    }

    enum TabNumStatus implements BaseEnum<Integer, String> {
        PUBLISHED(1, "已发布"),
        TOBE(2, "待审核"),
        DONE(3, "已审核");

        TabNumStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        private Integer code;
        private String name;
        @Override
        public Integer getCode() {
            return this.code;
        }

        @Override
        public String getName() {
            return this.name;
        }
    }

    enum DownloadStatus implements BaseEnum<Integer, String> {
        DONE(1, "已下载");

        DownloadStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        private Integer code;
        private String name;
        @Override
        public Integer getCode() {
            return this.code;
        }

        @Override
        public String getName() {
            return this.name;
        }
    }

    /**
     * 附件下载状态
     * @author: qiang.zhou
     * @date: 2024/11/29 14:02
     **/
    enum DownUseStatus implements BaseEnum<Integer, String> {
        WAIT(0, "未使用"),
        IN(1, "下载中");

        DownUseStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }
        private Integer code;
        private String name;
        @Override
        public Integer getCode() {
            return this.code;
        }

        @Override
        public String getName() {
            return this.name;
        }
    }


}
